<template>
	<view class="compileorder">
		<u-navbar
			title="商品编辑"
			:back-icon-size="28"
			back-icon-color="#000000"
			:title-size="28"
			:border-bottom="false"
			:back-text-style="{ color: '#000000', fontSize: '26rpx' }"
			title-color="#000000"
			:background="{ background: '#F7F7F7' }"
		></u-navbar>
		<!-- 检测弹窗 -->
		<!-- 		<view class="popmainbox">
			<u-popup
				v-model="popupshow"
				:scrolly="false"
				:safe-area-inset-bottom="true"
				:closeable="false"
				border-radius="10"
				width="620"
				height="680"
				mode="center"
				@close="popclose"
				@open="popopen"
			>
				<view class="popbox" @touchmove.stop.prevent="moveHandle">
					<view class="title u-font-16 u-flex u-col-center">
						<u-icon name="error-circle-fill" color="#EE0F1B" size="48"></u-icon>
						<text class="u-p-l-10">确认商品满足以下条件吗？</text>
					</view>
					<view class="tipsbox">
						<text>该商品上期服务费不满20，</text>
						<text style="color: red;">确认满足以下要求后点击确认继续进行上单。</text>
						<view class="u-m-t-15 u-m-b-15">-----要求-----</view>
						<text>10元以内降低两元价格 \n 20元以内降低三元价格 \n 50元以内降低五元价格 \n 100元以内降低十元价格 \n \n 或者佣金提高百分之5 \n \n</text>
						<text style="font-weight: 600; color: #000000;">上期券后价：59.00；佣金：10%</text>
					</view>
					<view class="footerbtn">
						<u-button
							:hair-line="true"
							:custom-style="{
								width: '160rpx',
								height: '60rpx',
								border: 'none',
								marginRight: '20rpx'
							}"
							@click="popupshow = false"
						>
							不太满足
						</u-button>
						<u-button
							:hair-line="false"
							:custom-style="{
								width: '160rpx',
								height: '60rpx',
								backgroundColor: '#FFDB28',
								border: 'none',
								color: 'white',
								marginRight: '20rpx'
							}"
							@click="dosure"
						>
							确认满足
						</u-button>
					</view>
				</view>
			</u-popup>
		</view> -->

		<!-- 		<view class="valueipt">
			<u-input v-model="value" :height="156" type="textarea" :border="true" :maxlength="150" placeholder="输入商品链接" />
			<u-button
				size="default"
				:ripple="true"
				:hair-line="false"
				:disabled="disabled"
				:custom-style="{
					color: disabled == true ? '#787882' : '#ffffff',
					backgroundColor: disabled == true ? '#DFDFDF' : '#FFDB28',
					border: 'none',
					marginTop: '52rpx'
				}"
				@click="doquery"
			>
				提交录入
			</u-button>
		</view> -->
		<view class="uporder">
			<view class="top">
				<text>商品id: {{ form.pd_itemId }}</text>
				<u-input
					v-if="ipttshow"
					:border="false"
					type="select"
					v-model="form.pd_cateText"
					placeholder="分类"
					:select-open="actionSheetShow"
					@click="actionSheetShow = true"
					key="ckf"
				></u-input>
				<u-input
					v-else
					:border="false"
					type="select"
					v-model="form.pd_cateText"
					placeholder="分类"
					:select-open="actionSheetShow"
					@click="actionSheetShow = true"
					key="ckf"
				></u-input>
			</view>
			<!-- 商品基本信息 -->
			<view class="goodsinfo">
				<u-field v-model="form.pd_subTitle" :label-width="150" label="短标题：" input-align="right" placeholder="10-16字内"></u-field>
				<u-field v-model="form.pd_goodsPrice" :label-width="150" label="商品原价：" input-align="right" placeholder="商品原价，不是券后价！"></u-field>
				<u-field v-model="form.pd_commissionRate" :label-width="150" label="佣金比例：" input-align="right" placeholder="20%填20"></u-field>
				<u-field
					v-model="form.pd_serviceRate"
					:label-width="150"
					label="服务费率："
					:border-bottom="false"
					input-align="right"
					placeholder="8%填8，线下填写服务费单价"
				></u-field>
			</view>
			<!-- 活动类型 -->
			<view class="goodsinfo u-m-t-26">
				<u-field
					@click="activeshow = true"
					v-model="form.active"
					:disabled="true"
					label="活动类型："
					:label-width="150"
					placeholder="请选择活动"
					:right-icon="activeicon"
				></u-field>
				<u-field
					@click="mannershow = true"
					v-model="form.manner"
					:disabled="true"
					label="结算方式："
					:label-width="150"
					placeholder="请选择结算方式"
					:right-icon="mannericon"
				></u-field>
				<u-action-sheet @click="clickItem" :list="activeList" v-model="activeshow"></u-action-sheet>
				<u-action-sheet @click="clickmanner" :list="mannerList" v-model="mannershow"></u-action-sheet>
			</view>
			<!-- 优惠卷 -->
			<!-- 			<view class="goodsinfo u-m-t-26">
				<u-field v-model="form.pd_couponUrl" :label-width="150" label="优惠券：" input-align="right" placeholder="优惠券地址" @blur="getcouponinfo"></u-field>
				<u-field v-model="form.pd_couponName" :label-width="150" label="券名称" input-align="right" placeholder="优惠券的券名称"></u-field>
				<u-field v-model="form.pd_couponSingle" :label-width="150" label="满xx可用" input-align="right" placeholder="优惠券单笔满xx可用"></u-field>
				<view class="couponbox">
					<view class="coupon_bg">
						<view class="coupon_left">{{ form.pd_couponName == '' ? '劵名称' : form.pd_couponName }}</view>
						<view class="coupon_center">
							<view class="roundtop"></view>
							<u-line color="#BBBBBB" border-style="dashed" direction="col" length="122" />
							<view class="roundbot"></view>
						</view>
						<view class="coupon_right">
							<view class="right_top u-font-18">
								<text style="color: #FFDB28;">{{ form.pd_couponMoney }}</text>
								元优惠券
							</view>
							<view class="">
								剩余
								<text style="color: #FFDB28;">{{ form.pd_couponSurplus }}</text>
								张 （
								<text style="color: #FFDB28;">{{ num }}</text>
								/{{ form.pd_couponNum }}）
							</view>
							<view class="">
								单笔满
								<text style="color: #FFDB28;">{{ form.pd_couponSingle == '' ? 'xx' : form.pd_couponSingle }}</text>
								元可用
							</view>
							<view class="">{{ form.pd_couponStartTime }} 至 {{ form.pd_couponEndTime }}</view>
						</view>
					</view>
				</view>
			</view> -->
			<!-- 卷后价 -->
			<view class="goodsinfo u-m-t-26">
				<u-field v-model="form.pd_goodsCouponPrice" :label-width="150" label="券后价：" input-align="right" placeholder="商品券后价"></u-field>
			</view>
			<!-- 推广文案 -->
			<view class="goodsinfo u-m-t-26 copywriting">
				<view class="title">推广文案：</view>
				<u-input v-model="form.pd_writing" :height="156" type="textarea" :border="false" :maxlength="100" :clearable="false" placeholder=" " />
				<view class="length">{{ form.pd_writing.length }}/100</view>
			</view>
			<!-- 朋友圈文案 -->
			<view class="goodsinfo u-m-t-26 copywriting">
				<view class="title">朋友圈文案：</view>
				<u-input v-model="form.pd_circleText" :height="156" type="textarea" :border="false" :maxlength="100" :clearable="false" placeholder=" " />
				<view class="length">&lt;br/&gt;为换行</view>
			</view>
			<!-- 上传主图 -->
			<view class="u-m-t-26 imgs">
				<view class="goodsinfo copywriting ">
					<view class="title">主图地址：</view>
					<u-input v-model="form.pd_goodsImgUrl" :height="200" type="textarea" :border="false" :clearable="false" placeholder=" " />
				</view>
				<view class="">
					<u-upload
						v-if="form.pd_goodsImgUrl == ''"
						action="https://app.letuilm.com/api/upload_tb_img"
						:width="300"
						:height="300"
						:file-list="fileList"
						:index="0"
						@on-error="uploaderr"
						@on-success="doupland"
						@on-remove="remove(0)"
						:max-count="1"
						:show-progress="false"
						:deletable="true"
						:custom-btn="true"
						:max-size="5 * 1024 * 1024"
						:limitType="['png', 'jpg', 'jpeg', 'webp']"
						ref="goodsimg"
					>
						<view slot="addBtn" class="convert" hover-class="slot-btn__hover" hover-stay-time="150">
							<u-icon name="plus" color="#101010" size="28"></u-icon>
							<view class="">转链</view>
						</view>
					</u-upload>
					<u-image v-else :width="300" :height="300" :src="form.pd_goodsImgUrl"></u-image>
				</view>
			</view>
			<!-- 上传营销图 -->
			<view class="goodsinfo u-m-t-26">
				<u-upload
					class="upload1"
					action="https://app.letuilm.com/api/upload_good_order"
					:width="356"
					:height="582"
					:file-list="fileList2"
					:index="1"
					@on-error="uploaderr"
					@on-success="doupland"
					@on-remove="remove(1)"
					:max-count="1"
					:show-progress="false"
					:deletable="true"
					:custom-btn="true"
					:max-size="5 * 1024 * 1024"
					:limitType="['png', 'jpg', 'jpeg', 'webp']"
				>
					<view slot="addBtn" class="uploadyx" hover-class="slot-btn__hover" hover-stay-time="150">
						<view style="text-align: center;">
							<u-icon name="photo" color="#101010" size="48"></u-icon>
							<view class="u-p-t-15">上传营销图</view>
						</view>
					</view>
				</u-upload>
				<!-- 	<view class="superbox">
					<u-image :src="form.pd_superUrl" :width="356" :height="582"></u-image>
				</view> -->
			</view>
			<!-- 联系方式 -->
			<view class="goodsinfo u-m-t-26">
				<u-field v-model="form.si_shopQq" :label-width="200" label="店铺QQ/WX：" input-align="right" placeholder="QQ/微信"></u-field>
				<u-field v-model="form.si_phone" :label-width="150" label="店铺电话：" input-align="right" placeholder="店铺电话"></u-field>
				<u-field v-model="form.si_contactQq" :label-width="150" label="联系QQ：" input-align="right" placeholder="自己用于联系商家的QQ"></u-field>
			</view>
			<!-- 备注 -->
			<view class="goodsinfo u-m-t-26"><u-field v-model="form.pd_mark" :label-width="150" label="商品备注：" input-align="right" placeholder="商品备注"></u-field></view>
			<u-button
				size="default"
				:ripple="true"
				:hair-line="false"
				:custom-style="{
					marginTop: '30rpx',
					color: '#ffffff',
					backgroundColor: '#FFDB28',
					border: 'none',
					fontWeight: 600
				}"
				@click="dosubmit"
			>
				确 认 修 改
			</u-button>
		</view>
		<u-select
			@click="actionSheetShow = true"
			value-name="id"
			label-name="title"
			:searchiptsty="iptsty"
			:isiptshow="false"
			v-model="actionSheetShow"
			:list="actionSheetList"
			@confirm="actionSheetCallback"
		></u-select>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
// #ifdef H5
import $ from '@/static/js/jquery.js';
// #endif
export default {
	name: 'compileorder',
	data() {
		return {
			num: 'xx',
			ipttshow: false,
			action: 'https://app.letuilm.com/api/upload', //file
			fileList: [
				// {
				// 	url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg'
				// }
			],
			fileList2: [],
			activeList: [
				{
					text: '普通活动',
					id: 1
				},
				{
					text: '淘抢购',
					id: 2
				},
				{
					text: '聚划算',
					id: 3
				}
			],
			mannerList: [
				{
					text: '支付金额/结算券后价*服务费',
					id: 1
				},
				{
					text: '支付金额*服务费率',
					id: 2
				},
				{
					text: '累计使用张数或件数*服务费单价',
					id: 3
				}
			],
			activeshow: false,
			mannershow: false,
			iptsty: {
				width: '100%'
			},
			form: {
				id: '',
				pd_cateText: '', //商品分类
				pd_itemId: '', //商品id
				pd_subTitle: '', //短标题
				pd_couponUrl: '', //优惠卷地址
				pd_commissionRate: '', //佣金比例
				pd_serviceRate: '', //服务费
				pd_activityType: '', //商品活动（普通1，淘抢购2，聚划算3）
				active: '',
				pd_selmType: '', //结算方式
				manner: '',
				pd_goodsCouponPrice: '', //券后价
				pd_couponNum: 'xx', //优惠卷数量
				pd_couponSurplus: 'xx', //优惠卷剩余数量
				pd_couponStartTime: '开始时间', //优惠券开始时间
				pd_couponEndTime: '结束时间', //结束时间
				status: 1, //检测状态 1通过 2未通过
				pd_couponName: '', //优惠卷名称
				pd_couponSingle: '', //优惠卷满多少可用
				pd_couponMoney: 'XX', //劵面值
				pd_writing: '', //商品文案
				pd_circleText: '', //朋友圈文案
				pd_goodsImgUrl: '', //商品主图
				pd_superUrl: '', //商品营销图
				pd_detailArr: '', //商品信息
				pd_mark: '', //备注
				si_shopQq: '', //店铺qq或微信
				si_phone: '', //店铺联系电话
				si_contactQq: '', //联系qq
				pd_goodsPrice: '' //商品原价
			},
			actionSheetList: [
				{
					title: '女装'
				},
				{
					title: '男装'
				},
				{
					title: '内衣'
				},
				{
					title: '母婴儿童'
				},
				{
					title: '美妆护肤'
				},
				{
					title: '家居'
				},
				{
					title: '鞋品'
				},
				{
					title: '箱包'
				},
				{
					title: '配饰'
				},
				{
					title: '美食'
				},
				{
					title: '文体车品'
				},
				{
					title: '家电数码'
				},
				{
					title: '医药保健'
				},
				{
					title: '果蔬'
				},
				{
					title: '其他'
				}
			],
			actionSheetShow: false,
			value: '',
			pd_cateText: '女装',
			popupshow: false,
			disabled: true,
			activeicon: 'arrow-down-fill',
			mannericon: 'arrow-down-fill',
			resArr: {
				// sellCount: "65万+"
				// categoryId: "121390013"
				// shopType: "B"
				// shopId: "105412024"
				// userId: "1744434502"
				// shopName: "金泰康旗舰店"
				// shopIcon: "//img.alicdn.com/imgextra//35/f6/TB1mppTFVXXXXaLXXXXSutbFXXX.jpg"
				// sellerNick: "金泰康旗舰店"
				// title: "艾草艾叶红花泡脚中药包男女士生姜草本足浴粉包祛寒濕祛濕去濕气"
				// rootCategoryId: "50025705"
			},
			priceMoney: 0,
			itemid: '',
			result: {},
			titlec: ''
		};
	},
	//实例创建完成后被立即调用
	created() {},
	watch: {
		value: function(val) {
			// console.log(this.form.username);
			if (val !== '') {
				this.disabled = false;
			} else {
				this.disabled = true;
				this.israteshow = false;
			}
		},
		activeshow: function(val) {
			if (val == true) {
				this.activeicon = 'arrow-up-fill';
			} else {
				this.activeicon = 'arrow-down-fill';
			}
		},
		mannershow: function(val) {
			if (val == true) {
				this.mannericon = 'arrow-up-fill';
			} else {
				this.mannericon = 'arrow-down-fill';
			}
		},
		'form.pd_goodsImgUrl': function(val) {
			if (val != '') {
				console.log(this.form.pd_goodsImgUrl);
			}
		},
		'form.pd_couponNum': function(val) {
			if (val != 'xx' && this.form.pd_couponSurplus != 'xx') {
				this.num = val - this.form.pd_couponSurplus;
			}
		},
		'form.pd_couponSurplus': function(val) {
			if (val != 'xx' && this.form.pd_couponNum != 'xx') {
				this.num = this.form.pd_couponNum - val;
			}
		}
	},
	onLoad(option) {
		if (option.item) {
			this.form = JSON.parse(decodeURIComponent(option.item));
			console.log(this.form);
			this.form.id = this.form.pd_id;
			let str = this.form.pd_superUrl;
			if (this.form.pd_superUrl.indexOf('img.letuilm.com') != -1) {
				this.form.pd_superUrl = str.replace(/img.letui/g, `//img.letui`);
			} else {
				this.form.pd_superUrl = str.replace(/\/public\/static/g, `//zsxt.letuilm.com/public/static`);
			}
			this.fileList2.push({
				url: this.form.pd_superUrl
			});
		}
	},
	//挂载开始之前被调用
	beforeMount() {},
	// onPullDownRefresh() {
	// 	//监听下拉刷新动作的执行方法，每次手动下拉刷新都会执行一次
	// 	console.log('refresh');
	// 	setTimeout(function() {
	// 		uni.stopPullDownRefresh(); //停止下拉刷新动画
	// 	}, 1000);
	// },
	//初次渲染完成
	onReady() {
		this.getcata(this.form.pd_itemId);
	},
	//全局只触发一次
	onLaunch() {},
	//从后台进入前台
	onShow() {},
	//前台进入后台
	onHide() {},
	methods: {
		remove(index) {
			if (index == 0) {
				this.form.pd_goodsImgUrl = '';
			} else {
				this.form.pd_superUrl = '';
			}
		},
		getcata(itemId) {
			let that = this;
			this.form.pd_itemId = itemId;
			let url = 'https://acs.m.taobao.com/h5/mtop.taobao.detail.getdetail/6.0/?&data=%7B%22itemNumId%22%3A%22' + itemId + '%22%7D&qq-pf-to=pcqq.group';
			// #ifdef MP
			uni.request({
				url: url,
				dataType: 'json',
				success: function(res) {
					if (res.statusCode == 200) {
						that.result = res.data;
						// console.log('MP', res.data.data);
						that.dogonext();
					}
				}
			});
			// #endif

			// #ifdef H5
			$.ajax({
				url: url,
				dataType: 'jsonp',
				//jsonp: 'callback',
				success: function(res) {
					// console.log('H5', res.data);
					that.result = res;
					that.dogonext();
				}
			});
			// #endif

			// #ifdef APP-PLUS
			uni.request({
				url: url,
				dataType: 'json',
				header: {
					Accept: '*/*',
					// 'Accept-Encoding': 'gzip, deflate, br',//编码
					Connection: 'keep-alive',
					'content-type': 'application/json',
					Host: 'acs.m.taobao.com',
					Referer: 'https://servicewechat.com/wx82f34d67497fedb3/devtools/page-frame.html',
					'sec-ch-ua': 'nwjs 75',
					'Sec-Fetch-Dest': 'empty',
					'Sec-Fetch-Mode': 'cors',
					'Sec-Fetch-Site': 'cross-site',
					'User-Agent':
						'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1 wechatdevtools/1.03.2009302 MicroMessenger/7.0.4 Language/zh_CN webview/'
				},
				success: function(res) {
					// console.log('app',res.data)
					that.result = res.data;
					that.dogonext();
				}
			});

			// #endif

			// 请求结束
			// console.log('result', this.result);
		},
		dogonext() {
			if (this.result.data) {
				// console.log('data', this.result.data);
				if (typeof this.result.data.apiStack != 'undefined') {
					let apiStack = this.result.data.apiStack[0].value;
					let stackArr = JSON.parse(apiStack);
					// console.log('apiStack', stackArr);
					this.priceMoney = parseFloat(stackArr.skuCore.sku2info[0].price.priceMoney) / 100;
					this.resArr.sellCount = stackArr.item.sellCount ? stackArr.item.sellCount : stackArr.item.vagueSellCount;
				} else {
					this.resArr.sellCount = 9999;
					let apiStack = this.result.data.mockData;
					// console.log('22', this.result.data)
					let stackArr = JSON.parse(apiStack);
					// console.log('apiStack', stackArr);
					this.priceMoney = stackArr.price.price.priceText;
				}

				this.resArr.categoryId = this.result.data.item.categoryId;
				this.resArr.shopType = this.result.data.seller.shopType;
				this.resArr.shopId = this.result.data.seller.shopId;
				this.resArr.userId = this.result.data.seller.userId;
				this.resArr.shopName = this.result.data.seller.shopName;
				this.resArr.shopIcon = this.result.data.seller.shopIcon;
				this.resArr.sellerNick = this.result.data.seller.sellerNick;
				this.resArr.title = this.result.data.item.title;
				this.resArr.rootCategoryId = this.result.data.item.rootCategoryId;

				if (!this.resArr.sellCount) {
					this.resArr.sellCount = this.result.data.item.commentCount;
				}

				// console.log('resArr', this.resArr);
				this.form.pd_detailArr = JSON.stringify(this.resArr);
				this.form.pd_subTitle = this.resArr.title;
				this.form.pd_goodsPrice = this.priceMoney;
				this.$u.api
					.getcate({
						rootCategoryId: this.resArr.rootCategoryId
					})
					.then(res => {
						// console.log('商品分类',res)
						// 走的失败回调
					})
					.catch(err => {
						console.log('商品分类', err);
						this.form.pd_cateText = err;
						this.ipttshow = true;
					});
			}
		},
		docheckitemid(id) {
			this.$u.api
				.docheckitemid({
					item_id: id
				})
				.then(res => {
					// console.log(res);
					if (res.code == 200) {
						if (res.data.is_add == true) {
							this.ischeck = true;
							this.form.status = 1;
						} else {
							this.popupshow = true;
							this.form.status = 2;
						}
					}
				})
				.catch(err => {
					console.log(err);
				});
		},
		dosubmit() {
			// console.log(this.form);
			//  pd_couponSingle  pd_selmType
			// this.form.pd_superUrl="5454545"
			this.$u.api
				.dochangegoods(this.form)
				.then(res => {
					// console.log(res);
					if (res.code == 200) {
						this.$refs.uToast.show({
							title: '修改成功!',
							type: 'success'
						});
						this.value = '';
						this.num = 'xx';
						this.form = {
							pd_cateText: '',
							pd_itemId: '',
							pd_subTitle: '',
							pd_couponUrl: '',
							pd_commissionRate: '',
							pd_serviceRate: '',
							pd_activityType: '',
							active: '',
							pd_selmType: '',
							manner: '',
							pd_goodsCouponPrice: '',
							pd_couponNum: 'xx',
							pd_couponSurplus: 'xx',
							pd_couponName: '',
							pd_couponSingle: '',
							pd_couponMoney: 'XX',
							pd_couponStartTime: '开始时间',
							pd_couponEndTime: '结束时间',
							pd_writing: '',
							pd_circleText: '',
							pd_goodsImgUrl: '',
							pd_superUrl: '',
							pd_detailArr: '',
							pd_mark: '',
							status: 1,
							si_shopQq: '',
							si_phone: '',
							si_contactQq: '',
							pd_goodsPrice: ''
						};
						uni.navigateBack({
						    delta: 1	
						});
					}
				})
				.catch(err => {
					// console.log(err);
					this.$refs.uToast.show({
						title: err.msg,
						type: 'error'
					});
				});
		},
		doupland(data, index, lists, name) {
			console.log('上传成功返回', data, index);
			if (data.data.success == true) {
				// lists[0].url = `//` + data.data.url;
				if (name == 0) {
					this.form.pd_goodsImgUrl = data.data.url;
				} else {
					this.form.pd_superUrl = data.data.url;
				}
			} else {
				this.$refs.uToast.show({
					title: '上传错误!',
					type: 'error'
				});
			}
		},
		uploaderr(res, index, lists, name) {
			console.log('上传错误返回', res, index, lists, name);
		},
		clickItem(index) {
			this.form.pd_activityType = this.activeList[index].id;
			this.form.active = this.activeList[index].text;
		},
		clickmanner(index) {
			this.form.manner = this.mannerList[index].text;
			this.form.pd_selmType = this.mannerList[index].id;
		},
		// 点击actionSheet回调
		actionSheetCallback(e) {
			console.log(e);
			this.form.pd_cateText = e[0].label;
			// this.form.classid = e[0].value;
		},
		dosure() {
			this.ischeck = true;
			this.popupshow = false;
		},
		popclose() {
			this.popupshow = false;
		},
		popopen() {
			this.popupshow = true;
		},
		moveHandle() {
			return;
		},
		getUrl(urlstr, name) {
			// console.log('urlstr', urlstr,'name',name);
			let i = urlstr.indexOf('?');
			urlstr = urlstr.slice(i, urlstr.length); // ?id=xxxxx&a=xxx
			var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
			var r = urlstr.substr(1).match(reg);
			if (r != null) {
				return unescape(r[2]);
			} else {
				return null;
			}
			//使用 let id = this.getUrl(this.value,'id');//注意 id是string
		},
		//检测链接
		doquery() {
			// this.popupshow = true;
			this.itemid = this.getUrl(this.value, 'id');
			this.docheckitemid(this.itemid);
			this.getcata(this.itemid);
		}
	}
};
</script>

<style lang="scss" scoped>
.compileorder {
	background-color: #f7f7f7;
	padding-bottom: 40rpx;
	min-height: 100vh;
	.valueipt {
		width: 628rpx;
		margin: 0 auto;
	}
	.popmainbox {
		.popbox {
			width: 550rpx;
			margin: 0 auto;

			.title {
				color: rgba(0, 0, 0, 0.85);
				margin: 26rpx 0 36rpx 0rpx;
			}
			.tipsbox {
				font-size: 28rpx;
			}
			.footerbtn::v-deep {
				margin-top: 32rpx;
				display: flex;
				justify-content: flex-end;
				align-items: flex-end;

				.u-btn {
					margin: 0;
				}
			}
		}
	}
	.uporder {
		padding: 0 38rpx;
		.top::v-deep {
			padding: 20rpx 0;
			display: flex;
			justify-content: space-between;
			align-items: center;
			.u-input {
				width: 284rpx;
				height: 60rpx;
				line-height: 60rpx;
				border: 2rpx solid #bbbbbb;
				flex: inherit;
				padding: 0 20rpx !important;
				border-radius: 16rpx;
				background-color: #ffffff;
				.u-input__input {
					min-height: 60rpx !important;
					line-height: 60rpx;
				}
				.uni-input-input {
					margin-top: -2rpx;
				}
			}
		}
		.goodsinfo {
			border: 2rpx solid #dfdfdf;
			border-radius: 12rpx;
			padding: 0 10rpx;
			background-color: #ffffff;
			.u-border-bottom:after {
				border-color: #dfdfdf;
			}
			.isopen {
				transition: transform 0.4s;
				transform: rotate(-180deg);
			}
			.couponbox {
				margin: 16rpx 0 32rpx 0;
				.coupon_bg {
					width: 618rpx;
					height: 190rpx;
					border-radius: 12rpx;
					background-color: #fe6d59;
					display: flex;
					justify-content: flex-start;
					align-items: center;
					overflow: hidden;
					margin: 0 auto;
					.coupon_left {
						width: 52rpx;
						height: 140rpx;
						margin: 0 30rpx 0 30rpx;
						color: white;
						font-size: 28rpx;
					}
					.coupon_center {
						width: 60rpx;
						height: 100%;
						position: relative;
						display: flex;
						justify-content: center;
						align-items: center;
						.roundtop {
							position: absolute;
							top: -30rpx;
							width: 60rpx;
							height: 60rpx;
							background-color: #ffffff;
							border-radius: 100rpx;
						}
						.roundbot {
							position: absolute;
							bottom: -30rpx;
							width: 60rpx;
							height: 60rpx;
							background-color: #ffffff;
							border-radius: 100rpx;
						}
					}
					.coupon_right {
						color: white;
						font-size: 24rpx;
						margin-left: 72rpx;
					}
				}
			}
			.upload1 {
				// background-color: #dfdfdf;
				padding: 30rpx 0 30rpx 26rpx;
			}
			.uploadyx {
				width: 358rpx;
				height: 582rpx;
				background-color: #dfdfdf;
				display: flex;
				justify-content: center;
				align-items: center;
				border-radius: 12rpx;
			}
		}
		.copywriting {
			position: relative;
			padding: 20rpx 28rpx;
			.title {
			}
			.u-input {
				border-bottom: 2rpx solid #303133;
			}
			.length {
				position: absolute;
				bottom: 20rpx;
				right: 28rpx;
				color: #dfdfdf;
			}
		}
		.imgs {
			display: flex;
			justify-content: space-between;
			align-items: center;
			.goodsinfo {
				width: 344rpx;
				// height: 300rpx;
				.u-input {
					border-bottom: 0rpx solid #303133;
				}
			}
			.convert {
				width: 300rpx;
				height: 300rpx;
				background-color: #dfdfdf;
				border-radius: 12rpx;
				display: flex;
				justify-content: center;
				align-items: center;
			}
		}
	}
}
</style>
